﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HTspcAppProject
{
    class Device
    {
        //设备号，决定了设备在窗体中的位置
        private int deviceNumber;
        //private bool runState;
        //private DeviceData runData;
        private double runTime;
        private double stopTime;
        private float oee;
        private int produceBatch;
        private int checkBatch;

        public Device(int number, char state)
        {
            //初始化一个设备
            deviceNumber = number;
            //if (state == '1')
            //    runState = true;
            //else
            //    runState = false;
            //一下为假设值，默认应该初始都给零
            SetValue(0, 0, 0, 0, 0);
        }

        public void SetValue(double run, double stop,float oee, int produce, int check)
        {
            this.runTime = run;
            this.stopTime = stop;
            this.oee = oee;
            this.produceBatch = produce;
            this.checkBatch = check;
        }

        public double RunTime
        {
            get { return runTime; }
        }

        public double StopTime
        {
            get { return stopTime; }
        }

        public float OEE
        {
            get { return oee; }
        }

        public int ProduceBatch
        {
            get { return produceBatch; }
        }

        public int CheckBatch
        {
            get { return checkBatch; }
            set { checkBatch = value; }
        }
    }
}
